package com.example.design.pattern.structure.component;

public class Leaf implements Component {

    private String name;
    
    public Leaf(String name) {
        this.name = name;
    }
    
    @Override
    public void operation() {
        System.out.println(name + ": operation");
    }

    @Override
    public void add(Component component) {
        System.out.println("not supported");
    }

    @Override
    public void remove(Component component) {
        System.out.println("not supported");
    }

    @Override
    public Component getChild(int i) {
        return null;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

}
